package a.h;

import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellRenderer;
import java.awt.*;
import java.awt.geom.AffineTransform;
import java.net.URL;

public class rb
  implements Icon, ListCellRenderer, TableCellRenderer
{
  private Icon a;
  private int b;
  private int c;
  double d;
  private DefaultListCellRenderer e = new DefaultListCellRenderer();
  private DefaultTableCellRenderer f = new DefaultTableCellRenderer();
  private String g;
  int i = 48;
  int j;
  public static int k;
  
  public rb(ob paramob, int paramInt1, int paramInt2)
  {
    if (m == 0)
    {
      this.j = 48;
      if (paramob == null)
      {
        this.g = dc.a().b("IMAGE_OPTION_ITEM.NO_IMAGE");
        if (m != 0) {
          return;
        }
        if (!ec.s) {
          break label89;
        }
      }
    }
    this.g = paramob.b("IMAGE_OPTION_ITEM.NO_IMAGE");
    label89:
    this.i = paramInt1;
    this.j = paramInt2;
  }
  
  public Component getListCellRendererComponent(JList paramJList, Object paramObject, int paramInt, boolean paramBoolean1, boolean paramBoolean2)
  {
    int m = ec.t;
    boolean bool = ec.s;
    this.e.getListCellRendererComponent(paramJList, "", paramInt, paramBoolean1, paramBoolean2);
    if (m == 0)
    {
      if (paramObject == null)
      {
        this.e.setIcon(null);
        this.e.setText(" ");
        this.a = null;
        return this.e;
      }
      this.a = null;
    }
    if (m == 0) {
      if ((paramObject instanceof dd))
      {
        if (m != 0) {
          break label156;
        }
        this.a = ((dd)paramObject).a();
        if (!bool) {
          break label147;
        }
      }
    }
    if (m == 0) {
      if ((paramObject instanceof Icon))
      {
        if (m != 0) {
          break label156;
        }
        this.a = ((Icon)paramObject);
      }
    }
    if ((bool) && ((paramObject instanceof URL))) {
      throw new IllegalArgumentException("value cannot be of type URL");
    }
    label147:
    if (m == 0)
    {
      if (this.a != null)
      {
        label156:
        this.b = this.a.getIconWidth();
        this.c = this.a.getIconHeight();
        if (m == 0)
        {
          if (this.b > this.c)
          {
            this.d = (this.b / this.i);
            this.b = this.i;
            this.c = ((int)(this.c / this.d));
            if (m != 0) {
              break label302;
            }
            if (!bool) {}
          }
          else
          {
            this.d = (this.c / this.j);
            this.b = ((int)(this.b / this.d));
          }
        }
        else {
          this.c = this.j;
        }
        if (m != 0) {
          break label326;
        }
        this.e.setIcon(this);
        label302:
        if (!bool) {}
      }
      else
      {
        this.e.setIcon(null);
      }
    }
    else {
      this.e.setText("");
    }
    label326:
    return this.e;
  }
  
  public void paintIcon(Component paramComponent, Graphics paramGraphics, int paramInt1, int paramInt2)
  {
    int m = ec.t;
    if (this.a != null)
    {
      Graphics2D localGraphics2D = (Graphics2D)paramGraphics;
      AffineTransform localAffineTransform = localGraphics2D.getTransform();
      double d1 = this.a.getIconHeight();
      double d2 = this.a.getIconWidth();
      double d3 = this.b / d2;
      if (m == 0)
      {
        if (paramComponent.getHeight() < this.c) {
          d3 *= paramComponent.getHeight() / this.c;
        }
        localGraphics2D.scale(d3, d3);
        if (m != 0) {}
      }
      else
      {
        if (paramComponent.getHeight() < this.c) {
          localGraphics2D.translate(0.0D, this.c * 0.5F * (1.0D - d3));
        }
        this.a.paintIcon(paramComponent, localGraphics2D, paramInt1, paramInt2);
      }
      localGraphics2D.setTransform(localAffineTransform);
    }
  }
  
  public int getIconWidth()
  {
    return this.b;
  }
  
  public int getIconHeight()
  {
    return this.c;
  }
  
  public Component getTableCellRendererComponent(JTable paramJTable, Object paramObject, boolean paramBoolean1, boolean paramBoolean2, int paramInt1, int paramInt2)
  {
    int m = ec.t;
    boolean bool = ec.s;
    if (m == 0)
    {
      if (paramObject != null)
      {
        this.a = null;
        localObject1 = paramObject.toString();
        if (m == 0) {
          if ((paramObject instanceof dd))
          {
            localObject2 = (dd)paramObject;
            if (m == 0)
            {
              if (((dd)localObject2).c())
              {
                this.f.setIcon(null);
                localObject3 = (JComponent)this.f.getTableCellRendererComponent(paramJTable, this.g, paramBoolean1, paramBoolean2, paramInt1, paramInt2);
                ((JComponent)localObject3).setToolTipText(null);
                return localObject3;
              }
              this.a = ((dd)localObject2).a();
            }
            Object localObject3 = ((dd)localObject2).b();
            if (m == 0) {
              if (localObject3 == null)
              {
                localObject1 = null;
                break label198;
              }
            }
            localObject1 = ((URL)localObject3).toString();
            if ((m == 0) && (!bool)) {
              break label198;
            }
          }
        }
        if (m == 0) {
          if ((paramObject instanceof Icon))
          {
            if (m != 0) {
              break label199;
            }
            this.a = ((Icon)paramObject);
          }
        }
        if ((bool) && ((paramObject instanceof URL))) {
          throw new IllegalArgumentException("value cannot be of type URL");
        }
        label198:
        label199:
        Object localObject2 = (JComponent)this.f.getTableCellRendererComponent(paramJTable, "", paramBoolean1, paramBoolean2, paramInt1, paramInt2);
        if (m == 0) {
          if (this.a != null)
          {
            this.b = this.a.getIconWidth();
            this.c = this.a.getIconHeight();
            if (m == 0) {
              if (this.b > this.c)
              {
                d1 = this.b / 48.0D;
                this.b = 48;
                this.c = ((int)(this.c / d1));
                if (m != 0) {
                  break label368;
                }
                if (!bool) {
                  break label344;
                }
              }
            }
            double d1 = this.c / 48.0D;
            this.b = ((int)(this.b / d1));
            this.c = 48;
            label344:
            this.f.setIcon(this);
            this.f.setText("");
            if (m != 0) {
              break label386;
            }
            label368:
            if (!bool) {
              break label379;
            }
          }
        }
        this.f.setIcon(null);
        label379:
        ((JComponent)localObject2).setToolTipText((String)localObject1);
        label386:
        return localObject2;
      }
      this.f.setIcon(null);
    }
    Object localObject1 = (JComponent)this.f.getTableCellRendererComponent(paramJTable, this.g, paramBoolean1, paramBoolean2, paramInt1, paramInt2);
    ((JComponent)localObject1).setToolTipText(null);
    return localObject1;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.h.rb

 * JD-Core Version:    0.7.0.1

 */